<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="author" content="YZC">
	<meta name="copyright" content="YZC">
	<title>菜单管理 - ${setting.siteName}</title>
	<link href="${base}/resources/admin/css/bootstrap.css" rel="stylesheet">
	<link href="${base}/resources/admin/css/font-awesome.css" rel="stylesheet">
	<link href="${base}/resources/admin/css/adminLTE.css" rel="stylesheet">
	<link href="${base}/resources/admin/css/common.css" rel="stylesheet">
	
	<script src="${base}/resources/admin/js/jquery.js"></script>
	<script src="${base}/resources/admin/js/bootstrap.js"></script>
	<script src="${base}/resources/admin/js/velocity.js"></script>
	<script src="${base}/resources/admin/js/icheck.js"></script>
	<script src="${base}/resources/admin/js/adminLTE.js"></script>
	<script src="${base}/resources/admin/js/common.js"></script>
	<script type="text/javascript">
		$().ready(function() {
			
			[@flash_message /]
			
		});
	</script>
</head>
<body class="hold-transition">
	<div class="container-fluid">
		<section class="content-header">
			<h1>
				菜单管理
				<span class="gray" style="font-size: 12px" title="共找到${page.totalRow}条记录">(${message("admin.page.total", page.totalRow)})</span>
			</h1>
			<ol class="breadcrumb">
				<li>
					<a href="${base}/admin/index" target="_top">
						<i class="fa fa-home"></i>
						${message("admin.common.index")}
					</a>
				</li>
				<li class="active">菜单管理</li>
			</ol>
		</section>
		<section class="content">
			<div class="row">
				<div class="col-xs-12">
					<form id="listForm" action="${base}/admin/menu/list" method="post">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-9">
										<div class="btn-group">
											<a class="btn btn-default" href="${base}/admin/menu/add">
												<i class="fa fa-plus"></i>
												${message("admin.common.add")}
											</a>
                                        </div>
										<div class="btn-group">
											<button class="btn btn-default" type="button" data-toggle="delete" disabled>
												<i class="fa fa-times"></i>
												${message("admin.common.delete")}
											</button>
											<button class="btn btn-default" type="button" data-toggle="refresh">
												<i class="fa fa-refresh"></i>
												${message("admin.common.refresh")}
											</button>
											<div class="btn-group">
												[#include "/admin/include/page_size.ftl"]
											</div>
										</div>
									</div>
									<div class="col-xs-3">
										<div class="box-tools">
											<div id="search" class="input-group">
												<div class="input-group-btn">
													<button class="btn btn-default" type="button" data-toggle="dropdown">
														<span>
															[#if pageable.searchProperty??]
																${message("Menu." + pageable.searchProperty)}
															[#else]
																${message("Menu.name")}
															[/#if]
														</span>
														<i class="caret"></i>
													</button>
													<ul class="dropdown-menu">
														<li[#if !pageable.searchProperty?? || pageable.searchProperty == "name"] class="active"[/#if] data-search-property="name">
															<a href="javascript:;">${message("Menu.name")}</a>
														</li>
														<li[#if pageable.searchProperty == "level_code"] class="active"[/#if] data-search-property="level_code">
															<a href="javascript:;">${message("Menu.level_code")}</a>
														</li>
														<li[#if pageable.searchProperty == "url"] class="active"[/#if] data-search-property="url">
															<a href="javascript:;">${message("Menu.url")}</a>
														</li>
													</ul>
												</div>
												<input name="pageable.searchValue" class="form-control" type="text" value="${pageable.searchValue}" placeholder="${message("admin.common.search")}">
												<div class="input-group-btn">
													<button class="btn btn-default" type="submit">
														<i class="fa fa-search"></i>
													</button>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="box-body table-responsive no-padding">
								<table class="table table-hover">
									<thead>
										<tr>
											<th>
												<i class="check-all fa fa-square-o" data-toggle="checkAll"></i>
											</th>
											<th>
												<a href="javascript:;" data-order-property="name">
													${message("Menu.name")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>
												<a href="javascript:;" data-order-property="level_code">
													${message("Menu.level_code")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>
												<a href="javascript:;" data-order-property="type">
													${message("Menu.type")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>
												<a href="javascript:;" data-order-property="url">
													${message("Menu.url")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>
												<a href="javascript:;" data-order-property="icon">
													${message("Menu.icon")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>
												<a href="javascript:;" data-order-property="is_enabled">
													${message("Menu.is_enabled")}
													<i class="fa fa-sort"></i>
												</a>
											</th>
											<th>${message("admin.common.action")}</th>
										</tr>
									</thead>
									<tbody>
										[#list page.list as menu]
											<tr>
												<td>
													<input name="ids" type="checkbox" value="${menu.id}">
												</td>
												<td>
													<span style="margin-left: ${menu.grade * 20}px;[#if menu.grade == 0] color: #000000;[/#if]">
														${menu.name}
													</span>
												</td>
												<td>
													${menu.levelCode}
												</td>
												<td>${menu.typeName}</td>
												<td>${menu.url}</td>
												<td>
													<i class="${menu.icon}">
													${menu.icon}
												</td>
												<td>
													[#if menu.isEnabled]
														<i class="fa fa-check"></i>
													[#else]
														<i class="fa fa-times"></i>
													[/#if]
												</td>
												<td>
													<a href="${base}/admin/menu/edit?id=${menu.id}">[${message("admin.common.edit")}]</a>
												</td>
											</tr>
										[/#list]
									</tbody>
								</table>
								[#if !page.list?has_content]
									<p class="no-result">${message("admin.common.noResult")}</p>
								[/#if]
							</div>
							[@pagination pageNumber = page.pageNumber totalPages = page.totalPage]
								[#include "/admin/include/pagination.ftl"]
							[/@pagination]
						</div>
					</form>
				</div>
			</div>
		</section>
	</div>
</body>
</html>